#ifndef COMMAND_H
#define COMMAND_H

#include <iostream>
#include <string>

class Command
{
public:
	Command(const char* s) : mValue(s){}
	Command(const std::string& s) : mValue(s){}
	Command(){}
	~Command(){}

	operator std::string&(){ return mValue; }
	bool operator==(const Command& c)
	{ return mValue == c.mValue; }

	Command& SetValue(const char* s)
	{ mValue = s; return *this; }
	Command& SetValue(const std::string& s)
	{ mValue = s; return *this; }
	const std::string& Value() const
	{ return mValue; }

	std::ostream& WriteBinary(std::ostream&) const;
	std::istream& ReadBinary(std::istream&);
	std::ostream& WriteToStream(std::ostream&) const;
	std::istream& ReadFromStream(std::istream&);

	static	const Command	EndOfParameter,
							OkOfConfig,
							ErrorOfConfig,
							Run,
							Running,
							EndOfRun;

private:
	std::string		mValue;
};

inline std::ostream& operator<<(std::ostream& os, const Command& c)
{
	c.WriteToStream(os); return os;
}

inline std::istream& operator>>(std::istream& is, Command& c)
{
	c.ReadFromStream(is); return is;
}

#endif